
/* <<< COPYRIGHT START >>>
 * Copyright 2006-Present OxygenSoftwareLibrary.com
 * Licensed under the GNU Lesser General Public License.
 * http://www.gnu.org/licenses/lgpl.html
 * 
 * @author: Ugorji Dick-Nwoke
 * <<< COPYRIGHT END >>>
 */


package oxygen.tool.wlfacade.plugins;

import oxygen.tool.facade.FacadePluginAdapter;
import oxygen.tool.wlfacade.WLFacadeContextHelper;
import oxygen.tool.wlfacade.helpers.WLServer;

public class Start extends FacadePluginAdapter {

  public Object execute() throws Exception {
    WLFacadeContextHelper wlctx = new WLFacadeContextHelper(ctx);
    return WLServer.startdomain(wlctx);
  }
  
  public Object execute(String name) throws Exception {
    WLFacadeContextHelper wlctx = new WLFacadeContextHelper(ctx);
    Object tbl = null;
    if(WLServer.isServer(wlctx, name)) {
      tbl = WLServer.startserver(wlctx, name);
    } else if(WLServer.isCluster(wlctx, name)) {
      tbl = WLServer.startcluster(wlctx, name);
    } 
    return tbl;
  }
  
}

